<%@ page language="java" contentType="text/html; charset=windows-1255"
	pageEncoding="windows-1255"%>
<%@page import="logic.Reports"%>
<%@page import="java.util.Set"%>
<%@page import="data.UserTuple"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@page import="com.sun.org.apache.xalan.internal.xsltc.compiler.sym"%>

<%@page import="guiDisplay.UserData2"%><html>
<head>
<title>secret 4 plus dog</title>
<meta http-equiv="Content-Type"
	content="text/html; charset=windows-1255">
<link href="secret4.css" rel="stylesheet" type="text/css">
</head>

<body bgcolor="#FF6600" dir="ltr">
<a href="login.jsp">Logout</a>    <a href="userPanel.jsp">Main panel</a>
<table height="100%" width="100%" border="0" cellspacing="3"
	cellpadding="2">
	<tr>
		<td width="10%">&nbsp;</td>
		<td valign="top">
		<table height="100%" width="100%" border="0" cellspacing="3"
			cellpadding="2">
			<tr height="20%">
				<td>&nbsp;</td>
			</tr>
			<tr height="80%">
				<td>
				<%
					String param1 = request.getParameter("movie");
					String param2 = request.getParameter("min");
					;
				%>
				<table align="left" width="100%" border="0" cellspacing="3"
					cellpadding="2">
					<tr>
						<td width="65%" align="left" valign="top">
						<table width="100%" border="0" cellspacing="3" cellpadding="2">
							<tr>
								<td class="title">Users who rated "<%
									out.println(param1);
								%>" <%
									out.println(param2);
								%> and up </td>
							</tr>
							<tr>
								<td>
								<table width="100%" border="0" cellspacing="3" cellpadding="2">
									<tr>
										<td>&nbsp;</td>
									</tr>
									<%
										if ((String) session.getAttribute("currentUser") == null) {
											response.sendRedirect("login.jsp");
										}else if (((String) session.getAttribute("type")).equals("user")) {
											response.sendRedirect("userPanel.jsp?Bad");
										} else {
											UserData2[] users = Reports.getMovieRaters(param1, Integer
													.parseInt(param2));
											for (int i=0 ; i<users.length ; i++) {
												out.println("<tr>");
												out
														.println("<td><table class=\"bolded\" width=\"100%\" border=\"0\" cellspacing=\"3\" cellpadding=\"2\">");
												out.println("<tr>");
												out
														.println("<td class=\"regular\" colspan=\"4\" valign=\"top\"><table width=\"100%\" bordercolor=\"#FF3300\"  border=\"1\" cellspacing=\"3\" cellpadding=\"2\">");
												out.println("<tr>");
												out
														.println("<td bgcolor=\"#FFCC00\"><table width=\"100%\"  border=\"0\" cellspacing=\"3\" cellpadding=\"2\">");
												out.println("<tr>");
												out.println("<td>Name:</td>");
												out.println("<td colspan=\"3\"><font style=\"font-weight:bold\" color=\"#0000FF\">"
																+ users[i].name + "</font></td>");
												out.println("<td>User Rating:</td>");
												out.println("<td colspan=\"3\"><font style=\"font-weight:bold\" color=\"#0000FF\">"
																+ users[i].rating + "</font></td>");
												
												out.println("</tr>");
												out.println("<tr>");
												out.println("<td>Sex:</td>");
												out.println("<td>" + (users[i].sex.equals("true") ? "Female" : "Male")
														+ "</td>");
												out.println("<td>Birth date:</td>");
												out.println("<td>" + users[i].bdate + "</td>");
												out.println("</tr>");
												out.println("</table>");
												out.println("</td>");
												out.println("</tr>");
												out.println("</table></td>");
												out.println("</tr>");

												out.println("</table>");
												out.println("</td>");

												out.println("</tr>");
											}
										}
									%>
								</table>
								</td>
							</tr>
						</table>
						</td>
						<td valign="top"><img src="Secret4PlusDog.jpg" width="220"
							height="407"></td>
					</tr>
				</table>
				</td>
			</tr>
		</table>
		</td>
		<td width="10%">&nbsp;</td>
	</tr>
</table>

</body>
</html>
